package org.jrfe.res;


/**
 *
 * @author Kalvis Freimanis
 */
public class Texture extends Resource {

	/** The GL texture ID */
	private int		textureID;
	
	/** The height of the image */
	private int		height;

	/** The width of the image */
	private int		width;

	/** The ratio of the textures x */
	private float	sRatio;

	/** The ratio of the textures y */
	private float	tRatio;

	/**
	 * Create a new texture
	 *
	 * @param target The GL target 
	 * @param textureID The GL texture ID
	 */
	public Texture(int textureID,String resourceName,String resourcePath) {
		super(resourceName,resourcePath);
		this.textureID = textureID;
		
	}
	
	public int getTextureID() {
		return textureID;
	}
	
	/**
	 * Set the height of the image
	 *
	 * @param height The height of the image
	 */
	public void setHeight(int height) {
		this.height = height;
		tRatio = 1.f / height;
		
	}

	/**
	 * Set the width of the image
	 *
	 * @param width The width of the image
	 */
	public void setWidth(int width) {
		this.width = width;
		sRatio = 1.f / width;
	}


	/**
	 * Get the height of the physical texture
	 *
	 * @return The height of physical texture
	 */
	public int getHeight() {
		return height;
	}

	/**
	 * Get the width of the physical texture
	 *
	 * @return The width of physical texture
	 */
	public int getWidth() {
		return width;
	}
	
	public float getSRatio() {
		return sRatio;
	}
	
	public float getTRatio() {
		return tRatio;
	}
	
}